/*
 * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef OHOS_FORM_FWK_FORM_MGR_ERRORS_H
#define OHOS_FORM_FWK_FORM_MGR_ERRORS_H

#include "errors.h"

namespace OHOS {
namespace {
    const unsigned int AAFWK_MODULE_FORMMGR = 0x03;
    // offset of aafwk error, only be used in this file.
    constexpr ErrCode AAFWK_FORMMGR_ERR_OFFSET = ErrCodeOffset(SUBSYS_AAFWK, AAFWK_MODULE_FORMMGR);
};

// Internal Error Code
enum {
    ERR_APPEXECFWK_FORM_COMMON_CODE = AAFWK_FORMMGR_ERR_OFFSET + 1, // 2293761
    ERR_APPEXECFWK_FORM_PERMISSION_DENY, // 2293762
    ERR_APPEXECFWK_FORM_PERMISSION_DENY_BUNDLE, // 2293763
    ERR_APPEXECFWK_FORM_PERMISSION_DENY_SYS, // 2293764
    ERR_APPEXECFWK_FORM_GET_INFO_FAILED, // 2293765
    ERR_APPEXECFWK_FORM_GET_BUNDLE_FAILED, // 2293766
    ERR_APPEXECFWK_FORM_INVALID_PARAM, // 2293767
    ERR_APPEXECFWK_FORM_INVALID_FORM_ID, // 2293768
    ERR_APPEXECFWK_FORM_FORM_ID_NUM_ERR, // 2293769
    ERR_APPEXECFWK_FORM_FORM_ARRAY_ERR, // 2293770
    ERR_APPEXECFWK_FORM_RELEASE_FLG_ERR, // 2293771
    ERR_APPEXECFWK_FORM_REFRESH_TIME_NUM_ERR, // 2293772
    ERR_APPEXECFWK_FORM_INVALID_BUNDLENAME, // 2293773
    ERR_APPEXECFWK_FORM_INVALID_MODULENAME, // 2293774
    ERR_APPEXECFWK_FORM_INVALID_PROVIDER_DATA, // 2293775
    ERR_APPEXECFWK_FORM_INVALID_REFRESH_TIME, // 2293776
    ERR_APPEXECFWK_FORM_FORM_ID_ARRAY_ERR, // 2293777
    ERR_APPEXECFWK_FORM_SERVER_STATUS_ERR, // 2293778
    ERR_APPEXECFWK_FORM_CFG_NOT_MATCH_ID, // 2293779
    ERR_APPEXECFWK_FORM_NOT_EXIST_ID, // 2293780
    ERR_APPEXECFWK_FORM_PROVIDER_DATA_EMPTY, // 2293781
    ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED, // 2293782
    ERR_APPEXECFWK_FORM_MAX_SYSTEM_FORMS, // 2293783
    ERR_APPEXECFWK_FORM_EXCEED_INSTANCES_PER_FORM, // 2293784
    ERR_APPEXECFWK_FORM_OPERATION_NOT_SELF, // 2293785
    ERR_APPEXECFWK_FORM_PROVIDER_DEL_FAIL, // 2293786
    ERR_APPEXECFWK_FORM_MAX_FORMS_PER_CLIENT, // 2293787
    ERR_APPEXECFWK_FORM_MAX_SYSTEM_TEMP_FORMS, // 2293788
    ERR_APPEXECFWK_FORM_NO_SUCH_MODULE, // 2293789
    ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY, // 2293790
    ERR_APPEXECFWK_FORM_NO_SUCH_DIMENSION, // 2293791
    ERR_APPEXECFWK_FORM_FA_NOT_INSTALLED, // 2293792
    ERR_APPEXECFWK_FORM_MAX_REQUEST, // 2293793
    ERR_APPEXECFWK_FORM_MAX_REFRESH, // 2293794
    ERR_APPEXECFWK_FORM_GET_BMS_FAILED, // 2293795
    ERR_APPEXECFWK_FORM_GET_AMSCONNECT_FAILED, // 2293796
    ERR_APPEXECFWK_FORM_GET_HOST_FAILED, // 2293797
    // error code in sdk
    ERR_APPEXECFWK_FORM_GET_FMS_FAILED, // 2293798
    ERR_APPEXECFWK_FORM_SEND_FMS_MSG, // 2293799
    ERR_APPEXECFWK_FORM_FORM_DUPLICATE_ADDED, // 2293800
    ERR_APPEXECFWK_FORM_IN_RECOVER, // 2293801
    ERR_APPEXECFWK_FORM_GET_SYSMGR_FAILED, // 2293802
    ERR_APPEXECFWK_FORM_SHARE_INFO_CHECK_FAILED, // 2293803
    ERR_APPEXECFWK_FORM_SHARING, // 2293804
    ERR_APPEXECFWK_FORM_FREE_INSTALL_TIMEOUT, // 2293805
    ERR_APPEXECFWK_FORM_START_FORM_USER_FAILED, // 2293806
    ERR_APPEXECFWK_FORM_FREE_INSTALL_FAILED, // 2293807
    ERR_APPEXECFWK_FORM_FREE_INSTALLATION, // 2293808
    ERR_APPEXECFWK_FORM_GET_DMS_PROXY_FAILED, // 2293809
    ERR_APPEXECFWK_FORM_DISTRIBUTED_SCHEDULE_FAILED, // 2293810
    ERR_APPEXECFWK_FORM_FORM_USER_NOT_EXIST, // 2293811
    ERR_APPEXECFWK_FORM_CONNECT_FORM_RENDER_FAILED, // 2293812
    ERR_APPEXECFWK_FORM_RENDER_SERVICE_DIED, // 2293813
    ERR_APPEXECFWK_FORM_NOT_TRUST, // 2293814
    ERR_APPEXECFWK_FORM_SHARING_MAX_SIZE, // 2293815
    ERR_APPEXECFWK_FORM_ADD_FORM_TIME_OUT, // 2293816
    ERR_APPEXECFWK_FORM_STATUS_TIMIE_OUT, // 2293817
    // error code in enable or disable form
    ERR_APPEXECFWK_FORM_DISABLE_REFRESH, // 2293818
    ERR_APPEXECFWK_FORM_REPEAT_DISABLE, // 2293819
    ERR_APPEXECFWK_FORM_RDB_REPEATED_BUILD, // 2293820
    ERR_APPEXECFWK_FORM_GET_APP_DISPOSED_STATUS_FAILED, // 2293821
    ERR_APPEXECFWK_FORM_SET_OPERATION_FAILED, // 2293822
    ERR_APPEXECFWK_FORM_LIVE_OP_UNSUPPORTED, // 2293823
    ERR_APPEXECFWK_SYSTEMCAP_ERROR, // 2293824
    ERR_APPEXECFWK_FORM_DIMENSION_ERROR, // 2293825
    // error code in form render service
    ERR_APPEXECFWK_FORM_EVENT_HANDLER_NULL, // 2293826
    ERR_APPEXECFWK_FORM_NOT_EXIST_RENDER_RECORD, // 2293827
    ERR_APPEXECFWK_FORM_NOT_EXIST_FORM_REQUEST, // 2293828
    ERR_APPEXECFWK_FORM_RUNTIME_FAILED, // 2293829
    ERR_APPEXECFWK_FORM_FORM_NODE_RELEASED, // 2293830
    ERR_APPEXECFWK_FORM_UICONTENT_INIT_FAILED, // 2293831
    ERR_APPEXECFWK_FORM_SURFACE_NODE_NOT_FOUND, // 2293832
    ERR_APPEXECFWK_FORM_SUPPLY_CLIENT_NULL, // 2293833
    ERR_APPEXECFWK_FORM_NOT_EXIST_RENDERER_GROUP, // 2293834
    ERR_APPEXECFWK_FORM_LIVE_OP_PAGE_INFO_MISTMATCH, // 2293835
    // error code in due control form
    ERR_APPEXECFWK_FORM_DUE_DISABLE, // 2293836
    ERR_APPEXECFWK_FORM_DUE_REMOVE, // 2293837
};

// External Error Code
enum {
    ERR_FORM_EXTERNAL_PERMISSION_DENIED = 201,
    ERR_FORM_EXTERNAL_NOT_SYSTEM_APP = 202,
    ERR_FORM_EXTERNAL_PARAM_INVALID = 401,
    ERR_FORM_EXTERNAL_SYSTEMCAP_ERROR = 801,
    ERR_FORM_EXTERNAL_KERNEL_ERROR = 16500001,
    ERR_FORM_EXTERNAL_KERNEL_MALLOC_ERROR = 16500002,
    ERR_FORM_EXTERNAL_IPC_ERROR = 16500050,
    ERR_FORM_EXTERNAL_SERVICE_CONNECTION_ERROR = 16500060,
    ERR_FORM_EXTERNAL_GET_INFO_FAILED = 16500100,
    ERR_FORM_EXTERNAL_FUNCTIONAL_ERROR = 16501000,
    ERR_FORM_EXTERNAL_FORM_ID_NOT_EXIST = 16501001,
    ERR_FORM_EXTERNAL_FORM_NUM_EXCEEDS_UPPER_BOUND = 16501002,
    ERR_FORM_EXTERNAL_OPERATION_FORM_NOT_SELF = 16501003,
    ERR_FORM_EXTERNAL_ABILITY_NOT_INSTALLED = 16501004,
    ERR_FORM_EXTERNAL_CONNECT_RENDER_FAILED = 16501005,
    ERR_FORM_EXTERNAL_RENDER_DIED = 16501006,
    ERR_FORM_EXTERNAL_FORM_NOT_TRUST = 16501007,
    ERR_FORM_EXTERNAL_ADD_FORM_TIME_OUT = 16501008,
    ERR_FORM_EXTERNAL_FORM_STATUS_TIMIE_OUT = 16501009,
    ERR_FORM_EXTERNAL_SET_OPERATION_FAILED = 16501010,
    ERR_FORM_EXTERNAL_LIVE_OP_UNSUPPORTED = 16501011,
    ERR_FORM_EXTERNAL_FORM_DIMENSION_ERROR = 16501012,
};
}  // namespace OHOS
#endif  // OHOS_FORM_FWK_FORM_MGR_ERRORS_H
